//==========================================================================
// Copyright (c) 2000-2009,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <winhack.h>
#include <ctype.h>
#include <string.h>

#include "consolewindow.h"

InternalCommand ConvertInternalSymbol(PWChar pwszCommand)
{
    if (!_wcsicmp(L"exit", pwszCommand)) {
        return InternalCommand_Exit;
    }

    if (!_wcsicmp(L"cd", pwszCommand)) {
        return InternalCommand_Cd;
    }

    if (!_wcsicmp(L"set", pwszCommand)) {
        return InternalCommand_Set;
    }

    if (!_wcsicmp(L"path", pwszCommand)) {
        return InternalCommand_Path;
    }

    if (!_wcsicmp(L"ver", pwszCommand)) {
        return InternalCommand_Ver;
    }

    if (!_wcsicmp(L"time", pwszCommand)) {
        return InternalCommand_Time;
    }

    if (!_wcsicmp(L"date", pwszCommand)) {
        return InternalCommand_Date;
    }

    if (!_wcsicmp(L"dir", pwszCommand)) {
        return InternalCommand_Dir;
    }

    if (!_wcsicmp(L"ls", pwszCommand)) {
        return InternalCommand_Ls;
    }

    if (!_wcsicmp(L"rm", pwszCommand) || !_wcsicmp(L"rmdir", pwszCommand)) {
        return InternalCommand_Rm;
    }

    if (!_wcsicmp(L"cp", pwszCommand) || !_wcsicmp(L"copy", pwszCommand)) {
        return InternalCommand_Cp;
    }

    if (!_wcsicmp(L"del", pwszCommand)) {
        return InternalCommand_Del;
    }

    if (!_wcsicmp(L"md", pwszCommand) || !_wcsicmp(L"mkdir", pwszCommand)) {
        return InternalCommand_Md;
    }

    if (!_wcsicmp(L"rd", pwszCommand)) {
        return InternalCommand_Rd;
    }

    if (!_wcsicmp(L"help", pwszCommand)) {
        return InternalCommand_Help;
    }

    if (!_wcsicmp(L"cls", pwszCommand)) {
        return InternalCommand_Cls;
    }

    if (!_wcsicmp(L"rename", pwszCommand) || !_wcsicmp(L"ren", pwszCommand)) {
        return InternalCommand_Rename;
    }

    if (!_wcsicmp(L"start", pwszCommand)) {
        return InternalCommand_Start;
    }

    return InternalCommand_Not;
}
